<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='../../../../assets/comments.xslt'?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="de-DE">
  <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
  <subtitle type="text">Marcus Rohrmoser mobile Software</subtitle>
  <updated>2017-11-30T15:14:42Z</updated>
  <link rel="alternate" type="text/html" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/#comments"/>
  <link rel="self" type="application/atom+xml" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/comments.xml"/>
  <id>https://blog.mro.name/2009/08/nsdateformatter-http-header/comments.xml</id>
  <generator uri="https://wordpress.org/" version="4.9.9">WordPress</generator>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[Marcus Rohrmoser]]></name>
      <uri>https://blog.mro.name/</uri>
    </author>
		<id>https://blog.mro.name/2009/08/nsdateformatter-http-header/comments.xml#comment-016</id>
    <updated>2021-04-11T19:31:53Z</updated>
		<content type="text"><![CDATA[// swift
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1
let fmt = DateFormatter()
fmt.timeZone = TimeZone(secondsFromGMT:0)
fmt.locale = Locale(identifier: "en_US_POSIX")
fmt.dateFormat = "EEE',' dd MMM yyyy HH':'mm':'ss 'GMT'" // rfc1123
guard let ret = fmt.date(from:str) else {
	fmt.dateFormat = "EEEE',' dd'-'MMM'-'yy HH':'mm':'ss z" // rfc850
	guard let ret = fmt.date(from:str) else {
		fmt.dateFormat = "EEE MMM d HH':'mm':'ss yyyy" // asctime
			return fmt.date(from:str)
		}
	return ret
}
return ret]]></content>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[Marcus Rohrmoser]]></name>
      <uri>https://blog.mro.name/</uri>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-160460</id>
    <updated>2013-03-01T13:51:53Z</updated>
    <content type="text"><![CDATA[I find the plain C approach[1] of MKNetworkKit appealing, but think it brings additional timezone offset. Didn't try yet, though.

[1] https://github.com/MugunthKumar/MKNetworkKit/blob/master/MKNetworkKit/Categories/NSDate%2BRFC1123.m ]]></content>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[Mark Aufflick]]></name>
      <uri>http://mark.aufflick.com</uri>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-156929</id>
    <updated>2013-02-14T00:20:00Z</updated>
    <content type="text"><![CDATA[FYI. NSDateFormatter is not thread safe, and neither is the icu library which it uses. In some client code I just saw a crash from this code in dateFromString: calling icu::VTimeZone.]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[Izzy]]></name>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-109411</id>
    <updated>2012-12-12T00:01:14Z</updated>
    <content type="text"><![CDATA[Thanks for the code. Can you add a license for this code?]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[Tony Mann]]></name>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-29874</id>
    <updated>2012-07-26T15:02:31Z</updated>
    <content type="text"><![CDATA[Thanks, worked perfectly.]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[bob]]></name>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-20150</id>
    <updated>2011-06-27T21:09:29Z</updated>
    <content type="text"><![CDATA[Your methods are not thread-safe. Consider that one thread runs the method and creates a formatter, and sets the static variable, then gets interrupted before it can set the date format, etc. Then another thread runs and sees that it is not nil, and then proceeds to use it, when it has not been set up. See?
Also, I am doubtful about your statement that -stringFromDate: is thread-safe. I've read from many places on the Internet that it is not.]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[How To Download a File Only If It Has Been Updated | iPhone Development Blog]]></name>
      <uri>http://iPhoneIncubator.com/blog/server-communication/how-to-download-a-file-only-if-it-has-been-updated</uri>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-19866</id>
    <updated>2011-06-18T15:52:03Z</updated>
    <content type="text"><![CDATA[[…] responds in English) otherwise the code will fail when run on devices in non-English countries. See this post for more […]]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[Michael]]></name>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-15602</id>
    <updated>2011-01-12T16:07:18Z</updated>
    <content type="text"><![CDATA[Thanks for sharing this, came in useful today!]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[How To Download a File Only If It Has Been Updated « iPhone App Development]]></name>
      <uri>http://iphoneappdevelopment.tk/?p=16</uri>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-14372</id>
    <updated>2010-12-22T11:01:50Z</updated>
    <content type="text"><![CDATA[[…] responds in English) otherwise the code will fail when run on devices in non-English countries. See this post for more […]]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[iWyre]]></name>
      <uri>http://iwyre.net/?p=4277</uri>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-11672</id>
    <updated>2010-10-18T17:50:59Z</updated>
    <content type="text"><![CDATA[[…] responds in English) otherwise the code will fail when run on devices in non-English countries. See this post for more […]]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[mro]]></name>
      <uri>https://blog.mro.name/</uri>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-6738</id>
    <updated>2010-04-22T15:07:38Z</updated>
    <content type="text"><![CDATA[this guy blogged almost the same some months earlier: http://www.websector.de/blog/2009/01/25/quick-tip-objective-c-formatting-an-rfc2822-date-of-an-rss-feed-using-nsdateformatter/]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[Benjamin Ragheb]]></name>
      <uri>http://www.benzado.com/</uri>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-4440</id>
    <updated>2009-12-20T21:54:00Z</updated>
    <content type="text"><![CDATA[Thank you for sharing, the part about setting the locale never would have occurred to me.]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[Der M-Blog - NSDateFormatter case sensitive trap]]></name>
      <uri>https://blog.mro.name/2009/12/nsdateformatter-case-sensitive-trap/</uri>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-4140</id>
    <updated>2009-12-03T14:06:33Z</updated>
    <content type="text"><![CDATA[[…] NSDateFormatter behaves slightly different than documented, the following might even be correct, as strange as it might look (mind the last two lines): […]]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[Joseph Russell]]></name>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-3794</id>
    <updated>2009-11-10T00:31:00Z</updated>
    <content type="text"><![CDATA[Thank you for posting this. I also found it very helpful in an issue I encountered with non-US locale settings on iphone OS causing API signature issues.]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
  <entry>
    <title>💬 <![CDATA['NSDateFormatter & Http Header']]></title>
    <author>
      <name><![CDATA[Jeff Garbers]]></name>
    </author>
    <id>https://blog.mro.name/?p=1210#comment-3102</id>
    <updated>2009-10-06T22:38:18Z</updated>
    <content type="text"><![CDATA[Thanks very much for this code… was having trouble getting Amazon S3 to accept my signatures, and it turned out to be because of the „GMT+00:00“ you mentioned. Your code worked great!]]></content>
    <thr:in-reply-to ref="https://blog.mro.name/?p=1210" href="https://blog.mro.name/2009/08/nsdateformatter-http-header/" type="text/html"/>
  </entry>
</feed>
